using JoyfulHomeJourney.BackEnd.Infrastructure.EFCore;
using JoyfulHomeJourney.BackEnd.Infrastructure.Dtos.Responses.Objects;
using JoyfulHomeJourney.BackEnd.Infrastructure.Tools;
namespace JoyfulHomeJourney.BackEnd.Server.Instances.Extends.Responses
{
	public static class ProductReviewsExtend
{
		public static ResponseProductReviewsDto ToResponseDto(this ProductReviews entity)
{			return new ResponseProductReviewsDto
			{
				createAt = entity.PrCreateAt,
				createAtStr =Tools.TimeToString(entity.PrCreateAt),
				id = entity.PrId,
				isAnonymous = entity.PrIsAnonymous,
				parentId = entity.PrParentId,
				productId = entity.PrProductId,
				rating = entity.PrRating,
				reviewText = entity.PrReviewText,
				updateAt = entity.PrUpdateAt,
				updateAtStr =Tools.TimeToString(entity.PrUpdateAt),
				user = entity.PrUser,
			};
		}
	}
}
